home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
cmln1085.arc
/
GSXGDP.INC
< prev
next >
Wrap
Text File
|
1986-02-27
|
5KB
|
118 lines
{ --- GDP procedures. INCLUDE WITH GSX IF ANY REQUIRED --- }
{*********************************************************}
procedure bar( xll, yll, xur, yur : integer);
{in: arguments correspond to lower left and upper right
(x,y) coordinates of the rectangular bar in NDC units }
{*********************************************************}
var contrl : array[1..6] of integer; {Some GDP
functions use a 6th element
of the contrl array as a secondary
identifier. Here bar = 1 }
ptsin : array[1..4] of integer;
intin, intout, ptsout : integer;
begin contrl[1] := 11;
contrl[2] := 2;
contrl[4] := 0;
contrl[6] := 1; {specifies bar}
ptsin[1] := xll;
ptsin[2] := yll;
ptsin[3] := xur;
ptsin[4] := yur;
setpblock( addr(contrl), addr(intin ),
addr( ptsin), addr(intout),
addr(ptsout));
callgdos( addr(pb))
end;
{************************************************************************}
procedure arc( radius, xcenter, ycenter, starta, enda : integer);
{in: center, radius, starting and ending angle to determine arc}
{************************************************************************}
{not currently supported on Rainbow displays, LA50, or LP100}
{assumes total arc lies within NDC coordinate boundaries}
const pi = 3.141592 ;
var contrl : array[1..6] of integer;
intin : array[1..2] of integer;
ptsin : array[1..8] of integer;
intout, ptsout : integer;
begin contrl[1] := 11;
contrl[2] := 4;
contrl[4] := 2;
contrl[6] := 2;
intin[1] := starta;
intin[2] := enda;
ptsin[1] := xcenter;
ptsin[2] := ycenter;
ptsin[3] := round(radius * cos(pi * starta / 1800)) + xcenter;
ptsin[4] := round(radius * sin(pi * starta / 1800)) + ycenter;
ptsin[5] := round(radius * cos(pi * enda / 1800)) + xcenter;
ptsin[6] := round(radius * sin(pi * enda / 1800)) + ycenter;
ptsin[7] := radius;
ptsin[8] := 0;
setpblock( addr(contrl), addr( intin),
addr(ptsin ), addr(intout),
addr(ptsout));
callgdos( addr(pb))
end;
{**********************************************************************}
procedure pie( xcenter, ycenter, x1,y1, x2,y2 : integer);
{in: center coordinates and two points on the circle.}
{**********************************************************************}
{Procedure draws and fills pie using current fill attributes}
{Assume total pie lies within NDC boundaries}
var contrl : array[1..6] of integer;
intin : array[1..2] of integer;
ptsin : array[1..8] of integer;
intout, ptsout : integer;
i : integer;
begin contrl[1] := 11;
contrl[2] := 4;
contrl[4] := 2;
contrl[6] := 3;
for i := 1 to 2 do intin[i] := 0;
ptsin[1] := xcenter;
ptsin[2] := ycenter;
ptsin[3] := x1;
ptsin[4] := y1;
ptsin[5] := x2;
ptsin[6] := y2;
ptsin[7] := round( sqrt( sqr(x1-x2) + sqr(y1-y2)));
ptsin[8] := 0;
setpblock( addr(contrl), addr( intin),
addr(ptsin ), addr(intout),
addr(ptsout));
callgdos( addr(pb))
end;
{*************************************************************************}
procedure circle( xcenter, ycenter, radius : integer);
{in: center coordinates and radius}
{*************************************************************************}
{Procedure draws and fills the circle using current fill attributes}
{Assumes total circle lies within NDC boundaries, thus no clipping occurs.
Some interesting wraparound fills occur of any points lie outside
these boundaries.}
var contrl, ptsin : array[1..6] of integer;
intin, intout, ptsout : integer;
begin contrl[1] := 11;
contrl[2] := 3;
contrl[4] := 0;
contrl[6] := 4;
ptsin[1] := xcenter;
ptsin[2] := ycenter;
ptsin[3] := xcenter + radius; {circumference points within}
ptsin[4] := ycenter; { NDC boundaries }
ptsin[5] := radius;
ptsin[6] := 0;
setpblock( addr(contrl), addr( intin),
addr(ptsin ), addr(intout),
addr(ptsout));
callgdos( addr(pb))
end;